from typing import List


def subset_without_dup(nums: List[int]):
    nums.sort()

    res = []
    path = []

    _subset(nums, res, path, 0)

    return res


def _subset(nums, res, path, i):
    res.append(path.copy())
    for j in range(i, len(nums)):
        if j > i and nums[j] == nums[j - 1]:
            continue
        path.append(nums[j])
        _subset(nums, res, path, j + 1)
        path.pop()


print(subset_without_dup([1, 2, 2]))
